import axios from './axios';

export const getTopics = () => {
    return axios.get('/topics')
}
export const getTopic = (id) => {
    return axios.get('/topic/' + id)
}
export const createTopic = (data) => {
    return axios.post('/topics', data)
}
export const getCollect = (loginname) => {
    return axios.get('/topic_collect/' + loginname)
}
export const collectTopic = (id) => {
    return axios.post('/topic_collect/collect ', id)
}
export const de_collectTopic = (id) => {
    return axios.post('/topic_collect/de_collect', id)
}
export const getLoginname = (token) => {
    return axios.post('/accesstoken', token);
}
//获取用户详情
export const userMess = (loginname) => {
    return axios.get('/user/' + loginname)
}
//获取未读消息数
export const unreadMess = (token) => {
    return axios.get('/message/count?accesstoken='+ token.accesstoken);
}